package com.learn.training.multithread.chapter6.minchapter1.demo4;

public class Demo4 {
    public static void main(String[] args) throws InterruptedException {
        var ts = new Thread[]{new AddStudentThread(), new DecStudentThread(), new AddTeacherThread(), new DecTeacherThread()};
        for (var t: ts) {
            t.start();
        }
        for (var t: ts) {
            t.join();
        }
        System.out.println("studentcount : " + Counter.studentCount);
        System.out.println("teachercount : " + Counter.teacherCount);
    }
}
